package com.vanke.agent.common;

import javax.jms.MapMessage;
import javax.jms.QueueSender;
import javax.jms.QueueSession;

/**
 * 基本数据类型(Map,list,set等)消息发送
 * @author v-nish03
 *
 */
public class QueueMapMessage extends QueueMsgTemplate {
	
	public final static String messageType = "messageType";
	public final static String messageContent = "messageContent";
	
	public final static String messageSource = "datacenter.sync";
	
	@Override
	public void sendMessage(QueueSession session, QueueSender sender)
			throws Exception {
		MapMessage map = session.createMapMessage();
		map.setStringProperty("messageSource", messageSource);
        map.setStringProperty(QueueMapMessage.messageType, this.getMessageType());
        map.setObjectProperty(QueueMapMessage.messageContent, this.getObj());
        sender.send(map);
	}

}
